<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
</body>
<script>
    //substr
    /* var sum = "123456789";
    var result = sum.substr(6);
    console.log(result); */

    //生成随机验证码
    /* function randomString(len) {
        var rdmString = "";
        for (; rdmString.length < len; rdmString += Math.random().toString().substr(2));
        return rdmString.substr(0, len);
    }

    var foo = (12.4 / 4.13) | 3;//结果为3
    // console.log(foo); */

    // 位非运算符
    // var a = 4;
    // console.log(~a);

    // var b = ~~4.9;//结果为3
    // console.log(b);
    // console.log(~~"我" === 0); //true

    // var c = ~~4.5 ;// 4
    // var c = Math.floor(4.5) ;// 4
    // var c = ~~-4.5; // -4
    // var c = Math.floor(-4.5); // -5
    // console.log(c);



    /* var a="1";
    var b=2;
    a=[b,b=a][0];
    console.log(a,b); */

    /* var a = "1";
    var b = 2;
    [a, b] = [b, a];
    console.log(a, b); */

    
    /* var zhang = {
        name: "张三",
        age: 18,
        say: "hellow"
    }
    console.log(zhang);
    console.table(zhang);

    var san = [55, 666, 555, 7777, "hellow"];

    console.table(san); */
</script>

</html>